﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:ExpensesClient_ViewModels="clr-namespace:ExpensesClient.ViewModels" 
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP7" 
    x:Class="ExpensesClient.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" 
    DataContext="{Binding MainPageViewModel, Mode=OneWay, Source={StaticResource Locator}}" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}" 
    FontSize="{StaticResource PhoneFontSizeNormal}" 
    Foreground="{StaticResource PhoneForegroundBrush}">


    <!--Sample code showing usage of ApplicationBar-->

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="Engineering World 2011 Expenses">
            <!--Pivot item one-->
            <controls:PivotItem Header="Expenses">
                <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,0,0">
                    <Button Content="Start a new expense report" Height="72" HorizontalAlignment="Left" Margin="6,6,0,0" x:Name="button1" VerticalAlignment="Top" Width="440" IsEnabled="{Binding CanStartNew}" >
                        <Custom:Interaction.Triggers>
                            <Custom:EventTrigger EventName="Click">
                                <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding StartNew, Mode=OneWay}"/>
                            </Custom:EventTrigger>
                        </Custom:Interaction.Triggers>
                    </Button>
                    <TextBox Height="72" HorizontalAlignment="Left" Margin="14,84,0,0" x:Name="textBox1" Text="{Binding ExpenseItemDescription, Mode=TwoWay}" VerticalAlignment="Top" Width="438" IsEnabled="{Binding CanAddExpense}" />
                    <TextBox Height="72" HorizontalAlignment="Left" Margin="257,162,0,0" x:Name="textBox2" Text="{Binding ExpenseItemAmount, Mode=TwoWay}" VerticalAlignment="Top" Width="189" TextAlignment="Right" IsEnabled="{Binding CanAddExpense}" />
                    <TextBlock Height="30" HorizontalAlignment="Left" Margin="33,183,0,0" x:Name="textBlock1" Text="Amount" VerticalAlignment="Top" />
                    <Button Content="Add expenses" Height="72" HorizontalAlignment="Left" Margin="0,240,0,0" x:Name="button2" VerticalAlignment="Top" Width="440" IsEnabled="{Binding CanAddExpense}" >
                        <Custom:Interaction.Triggers>
                            <Custom:EventTrigger EventName="Click">
                                <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding AddExpense, Mode=OneWay}"/>
                            </Custom:EventTrigger>
                        </Custom:Interaction.Triggers>
                    </Button>
                    <Button Content="Submit expenses" Height="72" HorizontalAlignment="Left" Margin="12,518,0,0" x:Name="button3" VerticalAlignment="Top" Width="440" IsEnabled="{Binding CanSubmit}" >
                        <Custom:Interaction.Triggers>
                            <Custom:EventTrigger EventName="Click">
                                <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding Submit, Mode=OneWay}"/>
                            </Custom:EventTrigger>
                        </Custom:Interaction.Triggers>
                    </Button>
                    <ListBox Margin="8,312,16,82" ItemsSource="{Binding ExpenseItems}" ItemTemplate="{StaticResource ExpenseItemDataTemplate}"/>
                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="About" FontSize="32" >
                <StackPanel VerticalAlignment="Center">
                    <TextBlock Text="Engineering World Expenses" FontSize="32" HorizontalAlignment="Center"/>
                    <TextBlock Text="Demo Application" HorizontalAlignment="Center"/>
                    
                    <TextBlock Text="Maurice de Beijer" FontSize="32" HorizontalAlignment="Center" Margin="0,100,0,0"/>
                    <TextBlock Text="ABL - The Problem Solver" FontSize="32" HorizontalAlignment="Center" />
                    <TextBlock Text="mauricedb@computer.org" FontSize="32" HorizontalAlignment="Center"/>


                </StackPanel>
            </controls:PivotItem>
        </controls:Pivot>

        <!--<Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>-->

        <!--TitlePanel contains the name of the application and page title-->
        <!--<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="Engineering World Expenses" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>-->

        <!--ContentPanel - place additional content here-->
    </Grid>

</phone:PhoneApplicationPage>